# 统计字符串中每个字符出现的次数
wordsCount = dict()
str = "Hello World!"
for char in str:
    if char in wordsCount:
        wordsCount[char] += 1
    else:
        wordsCount[char] = 1
print(wordsCount)
